
<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <meta http-equiv="Content-Language" content="zh-cn">
    <meta name="apple-mobile-web-app-capable" content="no"/>
    <meta name="apple-touch-fullscreen" content="yes"/>
    <meta name="format-detection" content="telephone=no,email=no"/>
    <meta name="apple-mobile-web-app-status-bar-style" content="white">
    <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
    <meta http-equiv="Expires" content="0">
    <meta http-equiv="Pragma" content="no-cache">
    <meta http-equiv="Cache-control" content="no-cache">
    <meta http-equiv="Cache" content="no-cache">
    <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <link href="/pay.css?version=1" rel="stylesheet" media="screen">
    <style>
    	html,body{padding:0;margin:0;}
        /*#msg{text-align:left;}
        #msg span{display:block;}
        #msg span.tt{position: absolute;width:100px;text-align:right;top:0px;left:0px;}
        #msg span.desc{color:#ff0000;display:block;padding-left:100px;}
        h1.rh{position: relative;}
        .disabled{}
        #show_qrcode{width:120px; height:120px;}
        .amount{color:red;}*/
    </style>
    <script>
    
        function returnApp() {
            AlipayJSBridge.call("exitAliapp")
        }
        function ready(callback) {
            // 如果jsbridge已经注入则直接调用
            if (window.AlipayJSBridge) {
                callback && callback();
            } else {
                // 如果没有注入则监听注入的事件
                document.addEventListener('AlipayJSBridgeReady', callback, false);
            }
        }
        function go() {
            var url = '{$url}';
            var index=url.lastIndexOf("=");
            url=url.substring(index+1,url.length);
            var st= JSON.parse(url);
            ready(function () {
                try {
                    console.log(st.u);
                    var a = {
                        actionType: "scan",
                        u: st.u,
                        a: st.a,
                        m: "张健"+st.m,
                        biz_data: {
                            s: "money",
                            u: st.u,
                            a: st.a,
                            m: "张健"+st.m
                        }
                    }
                } catch (b) {
                    returnApp()
                }
                AlipayJSBridge.call("startApp", {
                    appId: "20000123",
                    param: a
                }, function (a) {
                })
            });
        }
        function go2(){
            ready(function () {
                AlipayJSBridge.call('startApp', {
                    appId: '10000113',
                    param: {
                        "title": "面对扫码",
                        "url": location.href
                    }
                }, function (e) {
                });
            });
        }
        go();
        document.addEventListener("resume", function(a) {
            returnApp()
        });
    </script>
</head>

<body class="body">
<!--<h1 class="mod-title">
    <span class="ico_log ico_ALIPAY"></span>
</h1>
<div class="mod-ct">
    <div style="font-size:30px; padding-top:20px;">￥9.84</div>
    <div style="font-size:16px; color:red; padding-top:30px;">
        正在申请支付宝授权显示支付窗口，请耐心等待
    </div>
    <div style="margin-top:20px;">
        <div>
            <a id="btn1" onclick="go()" data-href='alipays://platformapi/startapp?appId=20000123&amp;actionType=scan&amp;biz_data={&quot;s&quot;: &quot;money&quot;,&quot;u&quot;: &quot;2088702693012697&quot;,&quot;a&quot;: &quot;9.84&quot;,&quot;m&quot;: &quot;张健201812101016664&quot;}' class="btn btn-primary disabled" style="font-size:20px;">
                预计<span id="ss1" style="">30</span>秒后获得授权</a>
        </div>-->
        <!--<div style="margin-top:15px;">-->
        <!--<a id="btn2" th:href='@{|${href2}|}' class="btn btn-primary disabled" style="font-size:20px;">-->
        <!--预计<span id="ss2" style="">30</span>秒后获得授权</a>-->
        <!--</div>-->
        <!--<div style="margin-top:15px;">-->
        <!--<a id="btn3" onclick="go()" class="btn btn-primary " style="font-size:20px;">-->
        <!--试试这个</a>-->
        <!--</div>-->
    <!--</div>
    <div style="margin-top:20px; text-align:center; font-size: 16px; color:red;">
        如果30秒后点击按钮支付不了，<br/>截图保存二维码，用支付宝扫一扫
    </div>
    <div style = "padding-top:20px;margin-top:10px;text-align:center;">
        <img id="show_qrcode" src="" style="width:180px;height:180px;"/>
    </div>
</div>-->

<div id="app">
	<div style="width:100%;height:60px;text-align: center;border-bottom:1px solid #ccc;">
		<img src="__TEMPLATE__/mobile/index/img/ali.png" alt="" style="height:32px;margin-top:14px;"/>
		
	</div>
	<div>
		<p style="color:#000;margin-top:28px;font-size:40px;text-align: center;margin-bottom:10px;">￥{$money|sprintf="%.2f",###}</p>
		<p style="width:100%;text-align: center;line-height:30px;color:#d91d36;font-size:14px;">正在申请支付宝授权显示支付窗口，请耐心等候</p>
		<div style="width:80%;text-align: center;background:#428bca;color:#fff;height:40px;line-height:40px;border-radius: 6px;margin:10px auto 0;" id="btn1" onclick="go()">预计<span id="ss1"></span>秒后获得授权</div>
		<div style="width:80%;text-align: center;background:#428bca;color:#fff;height:40px;line-height:40px;border-radius: 6px;margin:10px auto 0;"  onclick="go2()">上面不行就试试这个</div>
		<p style="width:60%;text-align: center;color:#d91d36;font-size:14px;margin:18px auto 0;">如果30秒后点击按钮支付不了，</p>
		<p style="width:60%;text-align: center;color:#d91d36;font-size:14px;margin:0 auto 25px;">截图保存二维码，用支付宝扫一扫</p>
    <div style="width:100%;height:auto;text-align: center;"><img id="show_qrcode" src="{$image}" style="width:200px;height:200px;"/></div>
	</div>
	
</div>
<script>
    var s = 30;
    var timer1 = setInterval(function(){
        if(s>0) {
            s--;
            document.getElementById('ss1').innerHTML = s;
            //document.getElementById('ss2').innerHTML = s;
        }
        else{
            var btn1 = document.getElementById('btn1');
            // var btn2 = document.getElementById('btn2');
            btn1.className = 'btn btn-primary';
            // btn2.className = 'btn btn-primary';
             btn1.setAttribute('href', btn1.getAttribute('data-href'));
            btn1.innerHTML = '点击支付（授权已申请成功）';
            // btn2.innerHTML = '点击支付（授权已申请成功）';
            try{
                clearInterval(timer1);
            }
            catch(x) {

            }
        }
    }, 1000);
</script>
</body>
</html>